public class Test {
    public static void main(String[] args) {
//        for循环的方式完成1-5阶乘之和
        int sum = 0;
        for (int j = 1; j <= 5 ; j++) {
            int ret = 1;
            for (int i = 1; i <= j ; i++) {
                ret *= i;
//                System.out.println(ret);

            }
            sum += ret;
        }
        System.out.println(sum);
    }
}
